<div class="monitor-tab-div">
	<!-- 基本信息 -->
	<div class="m-panel">
		<div class="m-panel-title">
			<span>基本信息</span>
		</div>
		<div class="m-panel-body base-info-div">
			<form class="bs-example form-horizontal xs-form">
	            <div id="base_info_monitor_div">
	                <div class="form-group">
	                    <label class="col-lg-2 control-label">监控器名称：</label>
	                    <label class="col-lg-4 control-label tl" data-id="monitorName"></label>
	                    <label class="col-lg-2 control-label">监控器类型：</label>
	                    <label class="col-lg-4 control-label tl" data-id="monitorTypeName"></label>
	                </div>

	                <div class="form-group">
	                    <label class="col-lg-2 control-label">操作系统：</label>
	                    <label class="col-lg-4 control-label tl" data-id="osType"></label>
	                    <label class="col-lg-2 control-label">操作系统版本号：</label>
	                    <label class="col-lg-4 control-label tl" data-id="osVersion"></label>
	                </div>
	                <div id="base_info_main_div">
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">系统位数：</label>
	                        <label class="col-lg-4 control-label tl" data-id="osBit"></label>
	                        <label class="col-lg-2 control-label">开机时间：</label>
	                        <label class="col-lg-4 control-label tl" data-id="bootTime"></label>
	                    </div>
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">主机名：</label>
	                        <label class="col-lg-4 control-label tl" data-id="hostName"></label>
	                        <label class="col-lg-2 control-label"></label>
	                        <label class="col-lg-4 control-label tl"></label>
	                    </div>
	                </div>
	                <div id="base_info_assetType_div">
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">被监控资产名称：</label>
	                        <label class="col-lg-4 control-label tl" data-id="assetName"></label>
	                        <label class="col-lg-2 control-label">资产类型：</label>
	                        <label class="col-lg-4 control-label tl" data-id="assetTypeName"></label>
	                    </div>
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">IP：</label>
	                        <label class="col-lg-4 control-label tl" data-id="mainIp"></label>
	                        <label class="col-lg-2 control-label">安全域：</label>
	                        <label class="col-lg-4 control-label tl" data-id="securityDomainName"></label>
	                    </div>
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">物理位置：</label>
	                        <label class="col-lg-4 control-label tl" data-id="locationCbName"></label>
	                        <label class="col-lg-2 control-label"></label>
	                        <label class="col-lg-4 control-label tl"></label>
	                    </div>
	                </div>
	                <div id="base_info_asset_div">
	                    <div class="form-group" style="height:0;padding:0"></div>
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">CPU个数：</label>
	                        <label class="col-lg-4 control-label tl" data-id="core"></label>
	                        <label class="col-lg-2 control-label">CPU核数：</label>
	                        <label class="col-lg-4 control-label tl" data-id="coreNum"></label>
	                    </div>
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">CPU品牌：</label>
	                        <label class="col-lg-4 control-label tl" data-id="brand"></label>
	                        <label class="col-lg-2 control-label"></label>
	                        <label class="col-lg-4 control-label tl"></label>
	                    </div>
	                </div>
	                <div class="form-group">
	                    <label class="col-lg-2 control-label">内存大小：</label>
	                    <label class="col-lg-4 control-label tl" data-id="memory"></label>
	                    <label class="col-lg-2 control-label"></label>
	                    <label class="col-lg-4 control-label tl"></label>
	                </div>
	                <div class="form-group">
	                    <label class="col-lg-2 control-label">磁盘容量：</label>
	                    <label class="col-lg-4 control-label tl" data-id="disk"></label>
	                    <label class="col-lg-2 control-label"></label>
	                    <label class="col-lg-4 control-label tl"></label>
	                </div>
	            </div>
	        </form>
		</div>
	</div>

	<div class="box">
		<div class="box-item" style="width:30%">
			<!-- 当前使用率-->
			<div class="m-panel">
				<div class="m-panel-title">
					<span>CPU当前使用信息</span>
				</div>
				<div class="m-panel-body">
					<div class="monitor-chart box" style="flex-direction:column">
						<div class="box useage-title">
							<div class="tc" style="flex:1">
								<span>1min</span><span id="one_secend">0</span>
							</div>
							<div class="tc" style="flex:1">
								<span>5min</span><span id="five_secend">0</span>
							</div>
							<div class="tc" style="flex:1">
								<span>15min</span><span id="fifteen_secend">0</span>
							</div>
						</div>
						<div class="useage-content" style="display: flex;flex: 1;flex-direction: column;justify-content: center;">
							<div class="box">
								<div>CPU使用率</div>
								<div style="flex:1"><div id="cpu_current_use_bg"></div></div>
								<span style="display: block;line-height: 28px;padding: 0 0 0 5px;" id="cpu_current_use_label"></span>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="box-item" style="flex:1">
			<!-- CPU/内存使用率-->
			<div class="m-panel">
				<div class="m-panel-title">
					<span>CPU使用率</span>
				</div>
				<div class="m-panel-body">
					<div id="cpu_use_line_chart" class="monitor-chart"></div>
				</div>
			</div>
		</div>
	</div>

	<div class="box">
		<div class="box-item" style="width:30%">
			<!-- 内存动态信息 -->
			<div class="m-panel">
				<div class="m-panel-title">
					<span>内存当前信息</span>
				</div>
				<div class="m-panel-body">
					<div id="memo_dync_chart" class="monitor-chart box" style="height:210px">
						<div id="phy_memory_info_div" style="flex:1"></div>
						<div id="ver_memory_info_div" style="flex:1"></div>
					</div>
				</div>
			</div>
		</div>
		<div class="box-item" style="flex:1">
			<!-- 分页空间使用率 -->
			<div class="m-panel">
				<div class="m-panel-title">
					<span>内存使用率</span>
				</div>
				<div class="m-panel-body">
					<div id="memory_use_line_chart" class="monitor-chart" style="height:210px"></div>
				</div>
			</div>
		</div>
	</div>

	<!-- 磁盘动态信息 -->
	<div class="m-panel">
		<div class="m-panel-title">
			<span>磁盘动态信息</span>
		</div>
		<div class="m-panel-body">
			<div id="disk_use_chart" class="monitor-chart clearfix" style="height:auto;min-height:100px;"></div>
		</div>
	</div>

	<!-- 系统信息 
	<div class="m-panel">
		<div class="m-panel-title">
			<span>系统信息</span>
		</div>
		<div class="m-panel-body" id="system_info_div">
			<div class="m-panel-body-card">
				<ul>
					<li class="active" data-action="io_list">磁盘IO</li>
					<li data-action="node_list">I-NODE</li>
					<li data-action="network_list">网卡</li>
					<li data-action="system_process_list">系统进程动态</li>
				</ul>
			</div>
			<div id="system_info_query_div" style="display:none">
				<form class="bs-example form-horizontal xs-form">
	                <div class="form-group">
	                	<label class="col-lg-2 control-label">使用用户：</label>
		                <div class="col-lg-2 mt5 mb5" id="user_div">
		                    <select class="form-control input-sm" data-type="select"
		                        data-flag="process_sel" id="user_el">
		                    </select>
		                </div>
		                <label class="col-lg-2 control-label" style="width:130px;">映像名称：</label>
		                <div class="col-lg-2 mt5 mb5" id="name_div">
		                    <select class="form-control input-sm" data-type="select"
		                        data-flag="process_sel" id="name_el">
		                    </select>
		                </div>
		                <label class="col-lg-2 control-label" style="width:130px;">排序查询：</label>
		                <div class="col-lg-2 mt5 mb5" id="query_div">
		                    <select class="form-control input-sm" data-type="select"
		                        data-flag="process_sel" disabled id="query_el">
		                        <option value="----">----</option>
		                        <option value="mem_usage">内存使用率</option>
		                        <option value="cpu_usage">CPU使用率</option>
		                    </select>
		                </div>
	                </div>
	            </form>
			</div>
			<div class="table-div" id="system_info_table" style="height:300px"></div>
		</div>
	</div>
	-->

	<!-- 配置监控信息 -->
	<div class="m-panel">
		<div class="m-panel-title">
			<span>配置监控信息</span>
		</div>
		<div class="m-panel-body" id="config_monitor_div">
			<div class="m-panel-body-card">
				<ul>
					<li class="active" data-action="process_list">进程</li>
					<li data-action="port_list">端口</li>
					<li data-action="msconfig_list">启动项监控</li>
					<!-- 
					<li data-action="account_list">主机账号口令策略监控</li>
					-->
				</ul>
			</div>
			<div class="table-div" id="config_monitor_table" style="height:300px"></div>
		</div>
	</div>

	<!-- 用户访问 -->
	<div class="m-panel">
		<div class="m-panel-title">
			<span>用户访问</span>
		</div>
		<div class="m-panel-body" id="user_access_div">
			<div class="table-div" id="user_access_table" style="height:300px"></div>
		</div>
	</div>

	<!-- 接口面板 -->
	<div class="m-panel">
		<div class="m-panel-title">
			<span>接口面板</span>
		</div>
		<div class="m-panel-body" style="height:auto;min-height:350px;">
			<div id="interface_info" class="col-lg-12 h-all"></div>
		</div>
	</div>
</div>

<div class="monitor-tab-div" data-type="event"></div>


<tem id="tem">
	<!-- 关键字详情模板 -->
	<div class="template" id="keyword_detail_tem">
		<span>文件路径：</span><label data-id="filePath"></label>
		<div class="table_div mt10" id="keyword_detail_list_div" style="height:300px" validate="required,path"></div>
	</div>
	<!-- 匹配结果详情模板 -->
	<div class="template" id="result_detail_tem">
		<span>文件路径：</span><label data-id="filePath"></label>
		<div class="table_div mt10" id="result_detail_list_div" style="height:300px" validate="required,path"></div>
	</div>
	<!-- 日志文件关键字编辑模板 -->
	<div class="template" id="config_edit_template">
		<div class="panel-body no-tb-padder">
			<form class="bs-example form-horizontal xs-form" id="query_form">
				<div class="form-group">
				    <label class="col-lg-2 control-label required">文件路径</label>
				    <div class="col-lg-8">	    
				    	<input type="hidden" data-id="keywordId">
				        <input type="text" class="form-control input-sm" maxlength="256" data-id="filePath" validate="required,path">
				    </div>	    
				</div>

				<div class="form-group">
					<div class="col-lg-6">
						<!-- 右移箭头 -->
						<div style="right:20px;top:20px;font-size:20px;z-index:2000" 
								id="chevron-right" class="pabs square">
							<i class="icon-chevron-right"></i>
						</div>
						<!-- 左移箭头 -->
						<div style="right:20px;top:60px;font-size:20px;z-index:2000" 
								id="chevron-left" class="pabs square">
							<i class="icon-chevron-left" ></i>
						</div>
						<div id="form-left-div">
							<div class="form-group">
							    <label class="col-lg-4 control-label required">关键字</label>
							    <div class="col-lg-6">
							        <input type="text" class="form-control input-sm"
							        	data-flag="keywordName">
							    </div>
						    </div>

						    <div class="form-group">
							    <label class="col-lg-4 control-label">匹配原则</label>
								<div class="col-lg-6">
									<select class="form-control input-sm" data-flag="fileRule" data-type="select">
										<option value=">"> > </option>
										<option value="="> = </option>
										<option value="<"> < </option>
									</select>
								</div>
							</div>

							<div class="form-group">
							    <label class="col-lg-4 control-label required">次数</label>
							    <div class="col-lg-6">
							        <input type="text" class="form-control input-sm"
							        	data-flag="times" validate="number">
							    </div>		    
							</div>
						</div>
					</div>

					<div class="col-lg-6">
						<div class="table_div" id="config_edit_table" style="height:260px"></div>
					</div>
				</div>
			</form>
		</div>
	</div>
</tem>
<script type="text/javascript">

$(document).ready(function (){
require([index_web_app_name + '/js/plugin/monitor/catagory/linux.js'] ,function (linux){

var urlParamObj = index_query_param_get()

view_init()

event_init()

index_form_init($("#system_info_query_div"))

function view_init()
{
	urlParamObj.time = $("#query_time_label").text()
	linux.base_info_render(urlParamObj)
	linux.cpu_info_chart(urlParamObj);
	linux.cpu_use_chart($("#cpu_use_line_chart") ,urlParamObj)
	linux.memory_use_chart($("#memory_use_line_chart") ,urlParamObj)
	linux.memory_info_chart($("#phy_memory_info_div") ,$("#ver_memory_info_div") ,urlParamObj)
	linux.first_disk_chart($("#disk_use_chart") ,urlParamObj)
	config_monitor_render()
	//system_info()
	linux.user_access_list($("#user_access_table") ,urlParamObj)
	linux.interface_render($("#interface_info") ,urlParamObj)
}

function event_init(){
	$("[data-flag=process_sel]").change(function (){
        linux.system_process_list($("#system_info_table") ,urlParamObj)
    });

	var user_select_url = "monitorview/os/windows/queryUsernameStore";
	var name_select_url = "monitorview/os/windows/queryImagenameStore";

    um_ajax_get({
        url : user_select_url,
        isLoad : false,
        paramObj : urlParamObj,
        successCallBack : function (data){
            var selBuff = [];
            for (var i = 0; i < data.length; i++) {
                selBuff.push({id:data[i].codevalue ,text:data[i].codename});
            }
            $("#user_el").select2({
                  data: selBuff,
                  width:"100%"
            });
            um_ajax_get({
                url : name_select_url,
                paramObj : urlParamObj,
                isLoad : false,
                successCallBack : function (data){
                    var selBuff = [];
                    for (var i = 0; i < data.length; i++) {
                        selBuff.push({id:data[i].codevalue ,text:data[i].codename});
                    }
                    $("#name_el").select2({
                          data: selBuff,
                          width:"100%"
                    });
                }
            });
        }
    });
}

window.index_monitor_init = function ()
{
	view_init()
}

// 系统信息
function system_info(){
	var el_ul = $("#system_info_div").find("ul")
	el_ul.find("li").unbind("click")
	el_ul.find("li").click(function (){
		$("#system_info_query_div").hide()
		$(this).siblings().removeClass("active")
		$(this).addClass("active")
		if ($(this).attr("data-action") == "process_list")
			$("#system_info_query_div").show()
		linux[$(this).attr("data-action")]($("#system_info_table") ,urlParamObj)
	})

	linux.io_list($("#system_info_table") ,urlParamObj)
}

// 配置监控
function config_monitor_render(){
	var el_ul = $("#config_monitor_div").find("ul")
	el_ul.find("li").unbind("click")
	el_ul.find("li").click(function (){
		$(this).siblings().removeClass("active")
		$(this).addClass("active")
		linux[$(this).attr("data-action")]($("#config_monitor_table") ,urlParamObj)
	})

	linux.process_list($("#config_monitor_table") ,urlParamObj)
}

// 监本文件监控
function script_file_monitor(){
	var el_ul = $("#script_file_monitor_div").find("ul")
	el_ul.find("li").unbind("click")
	el_ul.find("li").click(function (){
		$(this).siblings().removeClass("active")
		$(this).addClass("active")
		$("#script_file_add_btn").hide()
		linux[$(this).attr("data-action")]($("#script_monitor_table") ,urlParamObj)
	})

	linux.script_config_list($("#script_monitor_table") ,urlParamObj)
}

});
});
</script>